package com.df.hitime.base;

import lombok.Data;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;

/**
 * @Description:
 * @Author: huangwl
 * @CreateDate: 2018/12/5 17:26
 */
@Data
public class PageHelp {
    private int pageNumber = 1 ;
    private int pageSize = 10;

    public Pageable getPage(){
        return  PageRequest.of(pageNumber-1,pageSize);
    }
    public Pageable getPage(Sort sort) {
        return  PageRequest.of(pageNumber-1, pageSize, sort);
    }
}

